package org.example.design.chain.service;

import org.example.design.chain.bean.AuthInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Classname AuthLink
 * @Description 链路抽象类定义
 * @Date 2020/11/6 11:12 上午
 * @Created by xiangjd
 */
public abstract class AuthLink {
    protected Logger logger = LoggerFactory.getLogger(AuthLink.class);
    protected SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 时间格式化
    protected String levelUserId;
    protected String levelUsername;
    private AuthLink next;

    public AuthLink(String levelUserId, String levelUsername) {
        this.levelUserId = levelUserId;
        this.levelUsername = levelUsername;
    }

    public AuthLink next() {
        return next;
    }

    public AuthLink appendNext(AuthLink next) {
        this.next = next;
        return this;

    }

    public abstract AuthInfo doAuth(String uid, String orderId, Date authDate);
}
